<!--
 * @userName: 湫之恋
 * @Author: Seven
 * @Date: 2020-07-01 14:44:39
 * @LastEditors: Seven
 * @LastEditTime: 2020-07-02 10:19:30
 -->
<template>
  <el-form :inline="true" :model="estimate" class="demo-form-inline">
    <el-form-item label="评价等级">
      <el-select v-model="estimate.estimateNumber" placeholder="评价等级">
        <el-option  label="全部" value="all"></el-option>
        <el-option label="巴适" value="巴适"></el-option>
        <el-option label="将就" value="将就"></el-option>
        <el-option label="很差" value="很差"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">查询</el-button>
    </el-form-item>
  </el-form>
</template>
<script>
import axios from "axios";
import { createNamespacedHelpers } from "vuex";
var { mapState, mapActions ,mapMutations} = createNamespacedHelpers("estimate");
export default {
  data() {
    return {
      estimate: {
        estimateNumber: "all",
      }
    };
  },
  methods: {
    ...mapActions(["getEstimateAllAsync", "getEstimateByEstimateNumberAsync"]),
    ...mapMutations(["updateEstimateNumber"]),
    onSubmit() {
      this.updateEstimateNumber(this.estimate);
      if (this.estimate.estimateNumber == "all") {
        this.getEstimateAllAsync(this.estimate);
      } else {
        this.getEstimateByEstimateNumberAsync(this.estimate);
      }
    }
  }
};
</script>
<style scoped>
.el-table th,
.el-table td {
  text-align: center !important;
}
.el-main {
  line-height: normal !important;
}
.el-button--primary{
  background-color: #f3a83f;
  border: 1px solid #f3a83f;
}
</style>